/*
 *  This file is part of the SIRIUS libraries for analyzing MS and MS/MS data
 *
 *  Copyright (C) 2024 Bright Giant GmbH
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License as published by the Free Software Foundation; either
 *  version 2.1 of the License, or (at your option) any later version.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License along with SIRIUS.  If not, see <http://www.gnu.org/licenses/>.
 *
 *  NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 *  https://openapi-generator.tech
 *  Do not edit the class manually.
 */


package io.sirius.ms.sdk.model;

import java.util.Objects;
import java.util.Arrays;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import io.sirius.ms.sdk.model.ConnectionErrorClass;
import io.sirius.ms.sdk.model.ConnectionErrorType;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonTypeName;

/**
 * ConnectionError
 */
@JsonPropertyOrder({
  ConnectionError.JSON_PROPERTY_ERROR_TYPE,
  ConnectionError.JSON_PROPERTY_ERROR_KLASS,
  ConnectionError.JSON_PROPERTY_SIRIUS_ERROR_CODE,
  ConnectionError.JSON_PROPERTY_SIRIUS_MESSAGE,
  ConnectionError.JSON_PROPERTY_SERVER_RESPONSE_ERROR_CODE,
  ConnectionError.JSON_PROPERTY_SERVER_RESPONSE_ERROR_MESSAGE,
  ConnectionError.JSON_PROPERTY_ERROR,
  ConnectionError.JSON_PROPERTY_WARNING
})
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.14.0")
public class ConnectionError {
  public static final String JSON_PROPERTY_ERROR_TYPE = "errorType";
  @jakarta.annotation.Nonnull
  private ConnectionErrorType errorType;

  public static final String JSON_PROPERTY_ERROR_KLASS = "errorKlass";
  @jakarta.annotation.Nonnull
  private ConnectionErrorClass errorKlass;

  public static final String JSON_PROPERTY_SIRIUS_ERROR_CODE = "siriusErrorCode";
  @jakarta.annotation.Nonnull
  private Integer siriusErrorCode;

  public static final String JSON_PROPERTY_SIRIUS_MESSAGE = "siriusMessage";
  @jakarta.annotation.Nonnull
  private String siriusMessage;

  public static final String JSON_PROPERTY_SERVER_RESPONSE_ERROR_CODE = "serverResponseErrorCode";
  @jakarta.annotation.Nullable
  private Integer serverResponseErrorCode;

  public static final String JSON_PROPERTY_SERVER_RESPONSE_ERROR_MESSAGE = "serverResponseErrorMessage";
  @jakarta.annotation.Nullable
  private String serverResponseErrorMessage;

  public static final String JSON_PROPERTY_ERROR = "error";
  @jakarta.annotation.Nullable
  private Boolean error;

  public static final String JSON_PROPERTY_WARNING = "warning";
  @jakarta.annotation.Nullable
  private Boolean warning;

  public ConnectionError() {
  }

  public ConnectionError errorType(@jakarta.annotation.Nonnull ConnectionErrorType errorType) {
    
    this.errorType = errorType;
    return this;
  }

  /**
   * Get errorType
   * @return errorType
   */
  @jakarta.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_ERROR_TYPE)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)

  public ConnectionErrorType getErrorType() {
    return errorType;
  }


  @JsonProperty(JSON_PROPERTY_ERROR_TYPE)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setErrorType(@jakarta.annotation.Nonnull ConnectionErrorType errorType) {
    this.errorType = errorType;
  }

  public ConnectionError errorKlass(@jakarta.annotation.Nonnull ConnectionErrorClass errorKlass) {
    
    this.errorKlass = errorKlass;
    return this;
  }

  /**
   * Get errorKlass
   * @return errorKlass
   */
  @jakarta.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_ERROR_KLASS)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)

  public ConnectionErrorClass getErrorKlass() {
    return errorKlass;
  }


  @JsonProperty(JSON_PROPERTY_ERROR_KLASS)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setErrorKlass(@jakarta.annotation.Nonnull ConnectionErrorClass errorKlass) {
    this.errorKlass = errorKlass;
  }

  public ConnectionError siriusErrorCode(@jakarta.annotation.Nonnull Integer siriusErrorCode) {
    
    this.siriusErrorCode = siriusErrorCode;
    return this;
  }

  /**
   * Get siriusErrorCode
   * @return siriusErrorCode
   */
  @jakarta.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_SIRIUS_ERROR_CODE)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)

  public Integer getSiriusErrorCode() {
    return siriusErrorCode;
  }


  @JsonProperty(JSON_PROPERTY_SIRIUS_ERROR_CODE)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setSiriusErrorCode(@jakarta.annotation.Nonnull Integer siriusErrorCode) {
    this.siriusErrorCode = siriusErrorCode;
  }

  public ConnectionError siriusMessage(@jakarta.annotation.Nonnull String siriusMessage) {
    
    this.siriusMessage = siriusMessage;
    return this;
  }

  /**
   * Get siriusMessage
   * @return siriusMessage
   */
  @jakarta.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_SIRIUS_MESSAGE)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)

  public String getSiriusMessage() {
    return siriusMessage;
  }


  @JsonProperty(JSON_PROPERTY_SIRIUS_MESSAGE)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setSiriusMessage(@jakarta.annotation.Nonnull String siriusMessage) {
    this.siriusMessage = siriusMessage;
  }

  public ConnectionError serverResponseErrorCode(@jakarta.annotation.Nullable Integer serverResponseErrorCode) {
    
    this.serverResponseErrorCode = serverResponseErrorCode;
    return this;
  }

  /**
   * Get serverResponseErrorCode
   * @return serverResponseErrorCode
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_SERVER_RESPONSE_ERROR_CODE)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public Integer getServerResponseErrorCode() {
    return serverResponseErrorCode;
  }


  @JsonProperty(JSON_PROPERTY_SERVER_RESPONSE_ERROR_CODE)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setServerResponseErrorCode(@jakarta.annotation.Nullable Integer serverResponseErrorCode) {
    this.serverResponseErrorCode = serverResponseErrorCode;
  }

  public ConnectionError serverResponseErrorMessage(@jakarta.annotation.Nullable String serverResponseErrorMessage) {
    
    this.serverResponseErrorMessage = serverResponseErrorMessage;
    return this;
  }

  /**
   * Get serverResponseErrorMessage
   * @return serverResponseErrorMessage
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_SERVER_RESPONSE_ERROR_MESSAGE)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public String getServerResponseErrorMessage() {
    return serverResponseErrorMessage;
  }


  @JsonProperty(JSON_PROPERTY_SERVER_RESPONSE_ERROR_MESSAGE)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setServerResponseErrorMessage(@jakarta.annotation.Nullable String serverResponseErrorMessage) {
    this.serverResponseErrorMessage = serverResponseErrorMessage;
  }

  public ConnectionError error(@jakarta.annotation.Nullable Boolean error) {
    
    this.error = error;
    return this;
  }

  /**
   * Get error
   * @return error
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_ERROR)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public Boolean isError() {
    return error;
  }


  @JsonProperty(JSON_PROPERTY_ERROR)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setError(@jakarta.annotation.Nullable Boolean error) {
    this.error = error;
  }

  public ConnectionError warning(@jakarta.annotation.Nullable Boolean warning) {
    
    this.warning = warning;
    return this;
  }

  /**
   * Get warning
   * @return warning
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_WARNING)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public Boolean isWarning() {
    return warning;
  }


  @JsonProperty(JSON_PROPERTY_WARNING)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setWarning(@jakarta.annotation.Nullable Boolean warning) {
    this.warning = warning;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    ConnectionError connectionError = (ConnectionError) o;
    return Objects.equals(this.errorType, connectionError.errorType) &&
        Objects.equals(this.errorKlass, connectionError.errorKlass) &&
        Objects.equals(this.siriusErrorCode, connectionError.siriusErrorCode) &&
        Objects.equals(this.siriusMessage, connectionError.siriusMessage) &&
        Objects.equals(this.serverResponseErrorCode, connectionError.serverResponseErrorCode) &&
        Objects.equals(this.serverResponseErrorMessage, connectionError.serverResponseErrorMessage) &&
        Objects.equals(this.error, connectionError.error) &&
        Objects.equals(this.warning, connectionError.warning);
  }

  @Override
  public int hashCode() {
    return Objects.hash(errorType, errorKlass, siriusErrorCode, siriusMessage, serverResponseErrorCode, serverResponseErrorMessage, error, warning);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class ConnectionError {\n");
    sb.append("    errorType: ").append(toIndentedString(errorType)).append("\n");
    sb.append("    errorKlass: ").append(toIndentedString(errorKlass)).append("\n");
    sb.append("    siriusErrorCode: ").append(toIndentedString(siriusErrorCode)).append("\n");
    sb.append("    siriusMessage: ").append(toIndentedString(siriusMessage)).append("\n");
    sb.append("    serverResponseErrorCode: ").append(toIndentedString(serverResponseErrorCode)).append("\n");
    sb.append("    serverResponseErrorMessage: ").append(toIndentedString(serverResponseErrorMessage)).append("\n");
    sb.append("    error: ").append(toIndentedString(error)).append("\n");
    sb.append("    warning: ").append(toIndentedString(warning)).append("\n");
    sb.append("}");
    return sb.toString();
  }

  /**
   * Convert the given object to string with each line indented by 4 spaces
   * (except the first line).
   */
  private String toIndentedString(Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }

}

